package com.gxa.aiface.controller;

import org.springframework.web.bind.annotation.*;
import com.gxa.aiface.service.AIFaceService;
import javax.annotation.Resource;
import java.util.Map;

@RestController
@RequestMapping("/aiface")
public class AIFaceController {

    @Resource
    private AIFaceService faceLoginService;

    @RequestMapping("/checkface")
    @ResponseBody
    public Map<String, Object> checkface(@RequestParam(name = "imagebast64") StringBuffer imagebast64) {
        return faceLoginService.checkface(imagebast64);
    }

    @RequestMapping("/registerFace")
    @ResponseBody
    public Map<String, Object> registerFace(@RequestParam(name = "imagebast64") StringBuffer imagebast64) {
        return faceLoginService.registerFace(imagebast64);
    }

    /*
    {"result":null,"log_id":3878158940,"error_msg":"pic not has face","cached":0,"error_code":222202,"timestamp":1721524764}
    注册状态 isSuccess=false
    {"result":null,"log_id":234396854,"error_msg":"pic not has face","cached":0,"error_code":222202,"timestamp":1721524769}
    注册状态 isSuccess=false
    {"result":null,"log_id":4084805355,"error_msg":"chin contour is occlusion","cached":0,"error_code":223125,"timestamp":1721524775}
    注册状态 isSuccess=false

     */
}
